home *** CD-ROM | disk | FTP | other *** search
/ 9-Digit Zip Code Directory / 9-Digit Zip Code Directory (American Business Information) (ABIZIP-12).ISO / z4src.zip / UI_ENV.HPP < prev    next >
C/C++ Source or Header  |  1993-08-16  |  11KB  |  499 lines

  1. //    Zinc Interface Library - UI_ENV.HPP
  2. //    COPYRIGHT (C) 1990-1993.  All Rights Reserved.
  3. //    Zinc Software Incorporated.  Pleasant Grove, Utah  USA
  4.  
  5. #ifndef UI_ENV_HPP
  6. #define UI_ENV_HPP
  7.  
  8. #define ZIL_VERSION        350
  9. #define ZIL_REVISION    4
  10.  
  11. // ----- Compiler/Environment Dependencies ----------------------------------
  12.  
  13. #define VOIDF(function)    (function)
  14. #define VOIDP(pointer)    (pointer)
  15.  
  16. // Borland/Turbo C++
  17. #if defined(__BCPLUSPLUS__) || defined(__TCPLUSPLUS__)
  18. #    undef VOIDF
  19. #    define VOIDF(function)    ((void *)(function))
  20. #    undef VOIDP
  21. #    define VOIDP(pointer)    ((void *)(pointer))
  22. #    if defined(__OS2__)
  23. #        define ZIL_OS2        20
  24. #        define EXPORT
  25. #        define ZIL_BITS32
  26. #        define ZIL_LITTLEENDIAN
  27. #    elif defined(_WINDOWS) || defined(_Windows)
  28. #        define ZIL_MSWINDOWS    30
  29. //#        ifdef __DLL__
  30. //#            define EXPORT _export
  31. //#        else
  32. //#            define EXPORT huge
  33. //#        endif
  34. //#        define ZIL_BITS16
  35. //#        define ZIL_LITTLEENDIAN
  36. #        if defined(__WIN32__)
  37. #            define WIN32
  38. #        endif
  39. #        define ZIL_MSWINDOWS    30
  40. #        ifdef __DLL__
  41. #                define EXPORT _export
  42. #        else
  43. #            if defined(WIN32)
  44. #                define EXPORT
  45. #            else
  46. #                define EXPORT huge
  47. #            endif
  48. #        endif
  49. #        if defined(WIN32)
  50. #            define ZIL_BITS32
  51. #            define ZIL_LITTLEENDIAN
  52. #        else
  53. #            define ZIL_BITS16
  54. #            define ZIL_LITTLEENDIAN
  55. #        endif
  56. #    else
  57. #        define ZIL_MSDOS    20
  58. #        define EXPORT
  59. #        define ZIL_BITS16
  60. #        define ZIL_LITTLEENDIAN
  61. #    endif
  62. #    if __BORLANDC__ >= 0x0300
  63. #        define ZIL_DELETE
  64. #    endif
  65. #endif
  66.  
  67. // Zortech C++
  68. #if defined(__ZTC__)
  69. #    define ZIL_LINKBUG
  70. #    if defined(__OS2__)
  71. #        define ZIL_OS2        20
  72. #        define EXPORT
  73. #        define ZIL_BITS32
  74. #        define ZIL_LITTLEENDIAN
  75. #    elif defined(_WINDOWS) || defined(_Windows)
  76. #        define ZIL_MSWINDOWS    30
  77. #        ifdef __DLL__
  78. #            define EXPORT _export
  79. #        else
  80. #            define EXPORT
  81. #        endif
  82. #        define ZIL_BITS16
  83. #        define ZIL_LITTLEENDIAN
  84. #    else
  85. #        define ZIL_MSDOS    20
  86. #        define EXPORT
  87. #        define ZIL_BITS16
  88. #        define ZIL_LITTLEENDIAN
  89. #    endif
  90. #    if __ZTC__ >= 0x0310
  91. #        define ZIL_DELETE
  92. #    endif
  93. #endif
  94.  
  95. // Microsoft C++ (7.0)
  96. #if defined(_MSC_VER)
  97. #    define ZIL_LINKBUG
  98. #    if defined(_WINDOWS) || defined(_Windows) || defined(WIN32)
  99. #        define ZIL_MSWINDOWS    30
  100. #        ifdef __DLL__
  101. #            if defined(WIN32)
  102. #                define EXPORT __export
  103. #            else
  104. #                define EXPORT _export
  105. #            endif
  106. #        else
  107. #            define EXPORT
  108. #        endif
  109. #        if defined(WIN32)
  110. #            define ZIL_BITS32
  111. #            define ZIL_LITTLEENDIAN
  112. #        else
  113. #            define ZIL_BITS16
  114. #            define ZIL_LITTLEENDIAN
  115. #        endif
  116. #    else
  117. #        define ZIL_MSDOS    20
  118. #        define EXPORT
  119. #        define ZIL_BITS16
  120. #        define ZIL_LITTLEENDIAN
  121. #    endif
  122. #endif
  123.  
  124. // Watcom C++ (9.5)
  125. #if defined(__WATCOMC__)
  126. #    define ZIL_LINKBUG
  127. #    define ZIL_DELETE
  128. #    if defined(__OS2__)
  129. #        define ZIL_OS2        20
  130. #        define EXPORT
  131. #        define ZIL_BITS32
  132. #        define ZIL_LITTLEENDIAN
  133. #    elif defined(__WINDOWS__) ||  defined(__NT__)
  134. #        define ZIL_MSWINDOWS    30
  135. #        define WINNT
  136. #        ifdef __DLL__
  137. #            if defined(WIN32)
  138. #                define EXPORT __export
  139. #            else
  140. #                define EXPORT _export
  141. #            endif
  142. #        else
  143. #            define EXPORT
  144. #        endif
  145. #        if defined(__WINDOWS_386__) || defined(WIN32)
  146. #            define ZIL_BITS32
  147. #            define ZIL_LITTLEENDIAN
  148. #        else
  149. #            define ZIL_BITS16
  150. #            define ZIL_LITTLEENDIAN
  151. #        endif
  152. #    elif defined(__DVX__)
  153. #        define EXPORT
  154. #        define ZIL_BITS32
  155. #        define ZIL_LITTLEENDIAN
  156. #        define ZIL_LOAD_MOTIF    // Use ZIL_MOTIF not ZIL_LOAD_MOTIF in programs.
  157.  
  158.         struct _XDisplay;
  159.         struct XKeytrans;
  160.         struct _XrmHashBucketRec;
  161.         struct _XSQEvent;
  162. #    else
  163. #        define ZIL_MSDOS    20
  164. #        define EXPORT
  165. #        define ZIL_BITS32
  166. #        define ZIL_LITTLEENDIAN
  167. #    endif
  168. #endif
  169.  
  170. // DJGPP, GNU C++ port DOS (1.08)
  171. #if defined(__GNUC__) && defined(MSDOS)
  172. #    define ZIL_LINKBUG
  173. #    define ZIL_DELETE
  174. #    if defined(__DVX__)
  175. #        define EXPORT
  176. #        define ZIL_BITS32
  177. #        define ZIL_LITTLEENDIAN
  178. #        define ZIL_LOAD_MOTIF    // Use ZIL_MOTIF not ZIL_LOAD_MOTIF in programs.
  179.  
  180.         struct _XDisplay;
  181.         struct XKeytrans;
  182.         struct _XrmHashBucketRec;
  183.         struct _XSQEvent;
  184.  
  185.         extern "C" {
  186. #        define LC_ALL      0
  187. #        define LC_COLLATE  1
  188. #        define LC_CTYPE    2
  189. #        define LC_MONETARY 3
  190. #        define LC_NUMERIC  4
  191. #        define LC_TIME     5
  192.         struct lconv
  193.         {
  194.             char *decimal_point;
  195.             char *thousands_sep;
  196.             char *grouping;
  197.             char *int_curr_symbol;
  198.             char *currency_symbol;
  199.             char *mon_decimal_point;
  200.             char *mon_thousands_sep;
  201.             char *mon_grouping;
  202.             char *positive_sign;
  203.             char *negative_sign;
  204.             char int_frac_digits;
  205.             char frac_digits;
  206.             char p_cs_precedes;
  207.             char p_sep_by_space;
  208.             char n_cs_precedes;
  209.             char n_sep_by_space;
  210.             char p_sign_posn;
  211.             char n_sign_posn;
  212.         };
  213.  
  214.         struct lconv *localeconv( void );
  215.         char *setlocale( int category, const char *locale );
  216.         };
  217. #    else
  218. #        define ZIL_MSDOS    20
  219. #        define EXPORT
  220. #        define ZIL_BITS32
  221. #        define ZIL_LITTLEENDIAN
  222. #    endif
  223. #endif
  224.  
  225. // Metaware C++ (3.0)
  226. #if defined(__HIGHC__)
  227. #    define ZIL_LINKBUG
  228. #    define ZIL_DELETE
  229. #    if defined(_WINDOWS) || defined(_Windows) || defined(WIN32)
  230. #        define ZIL_MSWINDOWS    30
  231. #        ifdef __DLL__
  232. #            if defined(WIN32)
  233. #                define EXPORT __export
  234. #            else
  235. #                define EXPORT _export
  236. #            endif
  237. #        else
  238. #            define EXPORT
  239. #        endif
  240. #        if defined(WIN32)
  241. #            define ZIL_BITS32
  242. #            define ZIL_LITTLEENDIAN
  243. #        else
  244. #            define ZIL_BITS16
  245. #            define ZIL_LITTLEENDIAN
  246. #        endif
  247. #    else
  248. #        define ZIL_MSDOS    20
  249. #        define EXPORT
  250. #        define ZIL_BITS32
  251. #        define ZIL_LITTLEENDIAN
  252. #    endif
  253. #endif
  254.  
  255. // IBM C++
  256. #if defined(__IBMCPP__)
  257. #    define ZIL_LINKBUG
  258. #    define ZIL_DELETE
  259. #    define ZIL_OS2        21
  260. #    define EXPORT
  261. #    define ZIL_BITS32
  262. #    define ZIL_LITTLEENDIAN
  263. #endif
  264.  
  265. // Computer Associates C++ (Glockenspiel)
  266. #if defined(__GLOCKENSPIEL__)
  267. #    define ZIL_LINKBUG
  268. #    define ZIL_DELETE
  269. #    define ZIL_OS2        21
  270. #    define EXPORT
  271. #    define ZIL_BITS32
  272. #    define ZIL_LITTLEENDIAN
  273. #endif
  274.  
  275. // HP-UX, CC (cfront from HP) and Motif
  276. #if defined(__hpux)
  277. #    define ZIL_POSIX
  278. #    define EXPORT
  279. #    define ZIL_BITS32
  280. #    define ZIL_BIGENDIAN
  281. #    define ZIL_LOAD_MOTIF    // Use ZIL_MOTIF not ZIL_LOAD_MOTIF in programs.
  282. #endif
  283.  
  284. // Solaris 2.1, CC (cfront from SunPro) and Motif
  285. #if defined(sun)
  286. #    define ZIL_POSIX
  287. #    define EXPORT
  288. #    define ZIL_BITS32
  289. #    define ZIL_BIGENDIAN
  290. #    define ZIL_LOAD_MOTIF    // Use ZIL_MOTIF not ZIL_LOAD_MOTIF in programs.
  291. #    if defined(_SUNOS4)
  292. #        define XtPointer caddr_t
  293. #        define XTFUNCPROTO
  294. #        define CFRONT
  295. #    endif
  296. #endif
  297.  
  298. // Silicon Graphics and Motif
  299. #if defined(__sgi)
  300. #    define ZIL_POSIX
  301. #    define EXPORT
  302. #    define ZIL_BITS32
  303. #    define ZIL_BIGENDIAN
  304. #    define ZIL_LOAD_MOTIF    // Use ZIL_MOTIF not ZIL_LOAD_MOTIF in programs.
  305. #    define XTFUNCPROTO
  306. #endif
  307.  
  308. // IBM RS6000 and Motif
  309. #if defined(_IBM_RS6000)
  310. #    define ZIL_POSIX
  311. #    define EXPORT
  312. #    define ZIL_BITS32
  313. #    define ZIL_BIGENDIAN
  314. #    define ZIL_LOAD_MOTIF    // Use ZIL_MOTIF not ZIL_LOAD_MOTIF in programs.
  315. #    define ZIL_DELETE
  316. #endif
  317.  
  318. // MS-DOS, Quarterdeck DESQview/X with Motif, DJGPP G++
  319. #if defined(QDeckX)
  320. #    define ZIL_POSIX
  321. #    define EXPORT
  322. #    define ZIL_BITS32
  323. #    define ZIL_LITTLEENDIAN
  324. #    define ZIL_LOAD_MOTIF    // Use ZIL_MOTIF not ZIL_LOAD_MOTIF in programs.
  325. #    define ZIL_DELETE
  326.     extern "C" {
  327. #        define LC_ALL      0
  328. #        define LC_COLLATE  1
  329. #        define LC_CTYPE    2
  330. #        define LC_MONETARY 3
  331. #        define LC_NUMERIC  4
  332. #        define LC_TIME     5
  333.     struct lconv
  334.     {
  335.         char *decimal_point;
  336.         char *thousands_sep;
  337.         char *grouping;
  338.         char *int_curr_symbol;
  339.         char *currency_symbol;
  340.         char *mon_decimal_point;
  341.         char *mon_thousands_sep;
  342.         char *mon_grouping;
  343.         char *positive_sign;
  344.         char *negative_sign;
  345.         char int_frac_digits;
  346.         char frac_digits;
  347.         char p_cs_precedes;
  348.         char p_sep_by_space;
  349.         char n_cs_precedes;
  350.         char n_sep_by_space;
  351.         char p_sign_posn;
  352.         char n_sign_posn;
  353.     };
  354.  
  355.     struct lconv *localeconv( void );
  356.     char *setlocale( int category, const char *locale );
  357.     };
  358. #endif
  359.  
  360. // ----- General Definitions ------------------------------------------------
  361.  
  362. // Optimization switches for various compiler problems.
  363. #define ZIL_PERSISTENCE        // Zinc persistence.
  364. #define ZIL_STORAGE            // Zinc storage.
  365. #define ZIL_OPTIMIZE        // Size & speed optimization for members.
  366. #define ZIL_EDIT            // WOS_EDIT_MODE objects.
  367.  
  368. #if defined(ZIL_MSDOS)
  369. #    define MAXPATHLEN    128
  370. #    define ZIL_PATHSEP    ';'
  371. #    define ZIL_DIRSEP    '\\'
  372. #    define ZIL_DIRSEPSTR    "\\"
  373.     typedef char ichar_t;
  374.  
  375.     extern ichar_t _iCornerUL[];
  376.     extern ichar_t _iCornerUR[];
  377.     extern ichar_t _iCornerLL[];
  378.     extern ichar_t _iCornerLR[];
  379.     extern ichar_t _iHorizontal[];
  380.     extern ichar_t _iVertical[];
  381.     extern ichar_t _iLowerBox;
  382.     extern ichar_t _iUpperBox;
  383.     extern ichar_t _iFullBox;
  384.     extern ichar_t *_iSBUpArrow;
  385.     extern ichar_t *_iSBDownArrow;
  386.     extern ichar_t *_iSBLeftArrow;
  387.     extern ichar_t *_iSBRightArrow;
  388.     extern ichar_t *_iSBMiddleArrow;
  389.     extern ichar_t *_iWDownArrow;
  390.     extern ichar_t *_iWNormalMin;
  391.     extern ichar_t *_iWMinimized;
  392.     extern ichar_t *_iWNormalMax;
  393.     extern ichar_t *_iWMaximized;
  394.     extern ichar_t *_iActiveCheck;
  395.     extern ichar_t *_iInactiveCheck;
  396.     extern ichar_t *_iActiveRadio;
  397.     extern ichar_t *_iInactiveRadio;
  398.     extern ichar_t *_iCheckMark;
  399.  
  400.     extern void I_ScreenOpen(int *, int *, int *);
  401.     extern void I_ScreenClose(void);
  402.     extern void I_ScreenPut(int, int, int, int, void *);
  403.     extern void I_ScreenGet(int, int, int, int, void *);
  404.     extern int I_ScreenColor(int);
  405.     extern void I_CursorRemove(void);
  406.     extern void I_CursorPosition(int, int, int);
  407.  
  408.     extern int I_MouseOpen(void);
  409.     extern void I_MouseClose(void);
  410.     extern void I_MouseHalt(int);
  411.  
  412.     extern void I_KeyboardOpen(void);
  413.     extern void I_KeyboardClose(void);
  414.     extern void I_KeyboardRead(unsigned *, unsigned *, unsigned *);
  415.     extern int I_KeyboardQuery(unsigned *);
  416.  
  417.     extern void (*mouseQueueEvent)(unsigned, int *, int *);
  418.  
  419. #    define ZIL_EXT    ".DAT"
  420. #    define ZIL_BAK    ".BK?"
  421. #endif
  422.  
  423. #if defined(ZIL_MSWINDOWS)
  424. extern "C" {                                                                // BUG 1326
  425. #    include <windows.h>
  426. }
  427. #    define MAXPATHLEN    128
  428. #    define ZIL_PATHSEP    ';'
  429. #    define ZIL_DIRSEP    '\\'
  430. #    define ZIL_DIRSEPSTR    "\\"
  431. #    define ZIL_EXT    ".DAT"
  432. #    define ZIL_BAK    ".BK?"
  433. #endif
  434.  
  435. #if defined(ZIL_OS2)
  436. #    define HIWORD(arg) (((ULONG)arg >> 16) & 0x0000FFFF)
  437. #    define LOWORD(arg) ((ULONG)arg & 0x0000FFFF)
  438.     extern "C"
  439.     {
  440. #    include <os2.h>
  441.     }
  442. #    define MAXPATHLEN    128
  443. #    define ZIL_PATHSEP    ';'
  444. #    define ZIL_DIRSEP    '\\'
  445. #    define ZIL_DIRSEPSTR    "\\"
  446. #    define ZIL_EXT    ".DAT"
  447. #    define ZIL_BAK    ".BK?"
  448. #endif
  449.  
  450. #if defined(ZIL_POSIX)
  451.     extern "C" {
  452.         void cursorRemove(void);
  453.         void cursorPosition(int, int, int);
  454.     };
  455. #    define MAXPATHLEN    1024
  456. #    define ZIL_PATHSEP    ':'
  457. #    define ZIL_DIRSEP    '/'
  458. #    define ZIL_DIRSEPSTR    "/"
  459. #    define ZIL_EXT    ".dat"
  460. #    define ZIL_BAK    ".bk?"
  461. //  Compatibility with 3.5 Beta
  462. #   define ZIL_UNIX
  463. #endif
  464.  
  465. #if defined(__DVX__)
  466. #    define ZIL_PATHSEP    ';'
  467. #    define ZIL_DIRSEP    '\\'
  468. #    define ZIL_DIRSEPSTR    "\\"
  469.  
  470. #    define ZIL_EXT    ".dat"
  471. #    define ZIL_BAK    ".bk?"
  472. #endif
  473.  
  474. #if defined (ZIL_LOAD_MOTIF)
  475.     extern "C"
  476.     {
  477. #    include <X11/Intrinsic.h>
  478. #    include <Xm/Xm.h>
  479. #include <stdio.h>
  480.     }
  481.  
  482. #    if defined(XtSpecificationRelease)
  483. #        define ZIL_X11        XtSpecificationRelease
  484. #    else
  485. #        define ZIL_X11        4
  486. #    endif
  487. #    if defined(XmVersion)
  488. #        define ZIL_MOTIF    XmVersion
  489. #    else
  490. #        define ZIL_MOTIF    1001
  491. #    endif
  492. #    undef    ZIL_LOAD_MOTIF
  493. #endif
  494.  
  495. #define ZIL_HOTMARK    '&'
  496. #define ZIL_HOTMARKSTR    "&"
  497.  
  498. #endif    // UI_ENV_HPP
  499.